<?php include template("header"); ?>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#3E3E3E">
  <tr>
    <td width="200" align="center" valign="top"><table width="167" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="25"><img src="img/left_top.jpg" width="167" height="25" /></td>
      </tr>
      <tr>
        <td align="center" background="img/left_mid.jpg">

			<?php foreach($list as $array){ ?>
			<table width="109" border="0" cellspacing="0" cellpadding="0">
			  <tr>
				<td height="90" align="center" valign="middle"><a href="photo.php?page=<?php echo $page;?>&pageSize=<?php echo $pageSize;?>&id=<?php echo $array['id'];?>"><img src="<?php echo $array['imageurl'];?>" width="109" height="71" border=0/></a></td>
			  </tr>
			</table>
			<?php } ?>

          <br />
          <table width="150" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="40" align="right"><a href="
			  <?php
				if($page==1){
					echo "javascript:alert('已经是第一页！');";
				}else{
					echo "photo.php?page=".($page-1)."&order=".$order;
				}
			  ?>"><img src="img/left_but_l.jpg" width="28" height="28" border="0" /></a></td>
              <td align="center"><strong><span class="STYLE2"><?php echo $page;?></span>/<?php echo $pagenum;?>页</strong></td>
              <td width="40" align="left"><a href="
			  <?php
				if($page==$pagenum){
					echo "javascript:alert('已经是最后一页！');";
				}else{
					echo "photo.php?page=".($page+1)."&order=".$order;
				}
			  ?>"><img src="img/left_but_r.jpg" width="28" height="28" border="0" /></a></td>
            </tr>
          </table>
          <table width="150" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="50" align="center" valign="middle">
			  <select name="select" id="select" onChange="document.location.href='photo.php?order='+this.value">
                <option value="votenum" <?php if($order=='votenum'){echo "selected";} ?>>按人气排序</option>
                <option value="createtime" <?php if($order=='createtime'){echo "selected";} ?>>按发布时间</option>
              </select>
              </td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td height="32"><img src="img/left_foot.jpg" width="167" height="32" /></td>
      </tr>
    </table>
    </td>
    <td align="center" valign="top"><table width="150" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="10"></td>
      </tr>
    </table>
<style type="text/css">
.tablePost th{
	color:#fff;
	font-size:12px;
	font-weight:bold;
	line-height:25px;
}
</style>
<br/>
<br/>

<form action="post.php" method="post" enctype="multipart/form-data" class="tablePost">
    <table width="95%"  border="0" align="center"  cellspacing="0" cellpadding="0">
      <tr>
        <th width="150">标　　题：</th>
        <td align="left"><input type="text" name="title" id="title" datatype="limit" min="2" max="50" msg="标题最少为2个字符，最长为50个字符" require="true"/></td>
      </tr>
      <tr>
        <th>照　　片：</th>
        <td align="left">
		<div id="divimageurl"></div>
		<input type="text" name="imageurl" id="imageurl"/>
		<input type="hidden" name="thumburl" id="thumburl"/>
		</td>
      </tr>
      <tr>
        <th>作　　者：</th>
        <td align="left"><input type="text" name="author" id="author"  datatype="limit" min="2" max="50" msg="作者最少为2个字符，最长为50个字符"/></td>
      </tr>
      <tr>
        <th>电　　话：</th>
        <td align="left"><input type="text" name="phone" id="phone" datatype="limit|number" min="2" max="50" msg="电话只能位数字" min="2" max="50" require="true"/></td>
      </tr>
     <!-- <tr>
        <td>作　　品：</td>
        <td align="left"><textarea name="content" id="content"></textarea></td>
      </tr>-->
      <tr>
        <th>描　　述：</th>
        <td align="left"><textarea name="description" id="description" cols='35' rows='10' datatype="limit"  msg="描述最少为10个字符，最多为100个字符" min="20" max="400" require="true"></textarea></td>
      </tr>
      <tr>
        <th>&nbsp;</th>
        <td align="left">
		<input type="hidden" name="step" id="step" value="2">
		<input type="submit" value=" 提 交 " class="Btn BtnNml"  id="submit" disabled/>
		</td>
      </tr>
    </table>
</form>
    </td>
  </tr>
</table>
<script language="javascript">
$(function(){
	$("form").checkForm(1);
	fileupload("imageurl","*.png;*.gif;*.jpeg;*.jpg;*.jsp","<?php echo $_CONFIG['uploadmax']*1024;?>");
});
function uploadfinish(event,queueid,fileObj,response,data){
	if(response.indexOf("Success")!=-1){
		response = response.replace("Success:","");
		var obj = response.split("|");
		$("#imageurl").val(obj[0]);
		$("#thumburl").val(obj[1]);
		$("#submit").attr("disabled",false);
		$("#divimageurl").html("<img src='"+obj[1]+"' class='thickbox' href='"+obj[0]+"'/>");
		tb_init("img.thickbox");
	}else{
		alert(response);
	}
}

</script>

<?php include template("footer"); ?>